package org.apache.click.doubleclick.inject;

import org.apache.click.Page;

/**
 * Underlying implementation is responsible for resolving different type of context. The context type
 * includes {@link javax.servlet.ServletContext} and other dependency injector contexts (Spring, Guice, etc).
 *
 * @author Jahid Shohel(development.jsh@gmail.com)
 * @param <T>   The context type
 */
public interface ContextResolver<T> {
    /**
     * Resolves dependency injector context (Spring, Guice, etc).
     *
     * @return Resolved context.
     */
    public T resolveDependencyInjectorContext();

    /**
     * Resolves dependency injector context (Spring, Guice, etc) retrieved using the page.
     *
     * @param page The page to retrieve the injector context.
     * @return Resolved context.
     */
    public T resolveDependencyInjectorContext(Page page);

//    /**
//     * Resolves servlet context from thread local using {@link org.apache.click.Context}.
//     *
//     * @return Retrieved servlet context.
//     */
//    public ServletContext resolveServletContext();
//
//    /**
//     * Resolves servlet context for specific page using {@link org.apache.click.Context}
//     *
//     * @param page The page instance to find the context.
//     * @return Retrieved servlet context.
//     */
//    public ServletContext resolveServletContext(Page page);
}
